<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class ResetPassword extends Mailable
{
    use Queueable, SerializesModels;
    protected $_user;

    /**
     * Create a new message instance.
     *
     * @param $_userInfo
     */
    public function __construct($_userInfo)
    {
        $this->_user = $_userInfo;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->view('emails.resetPassword')
            ->subject('易微链账户密码重置通知')
            ->with([
                'name' => array_get($this->_user, 'name'),
                'password' => array_get($this->_user, 'password'),
                'alias' => array_get($this->_user, 'alias'),
            ]);
    }
}
